﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="Employees.aspx.cs" Inherits="Employees" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>Employees</title>

    <script language="JavaScript" src="js/CalendarPopup.js"></script>

    <script language="JavaScript">
        var cal = new CalendarPopup();
    </script>

    <style>
        select
        {
            width: 144px !important;
        }
        input
        {
            width: 140px !important;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table border="0" cellpadding="1" cellspacing="1">
        <tr>
            <td width="15%">
                ID:
            </td>
            <td>
                <asp:TextBox ID="txtID" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
                Last Name:
            </td>
            <td>
                <asp:TextBox ID="txtLastName" runat="server"></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvLastName" runat="server" ControlToValidate="txtLastName">Please input!</asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td>
                First Name:
            </td>
            <td>
                <asp:TextBox ID="txtFirstName" runat="server"></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvFirstName" runat="server" ControlToValidate="txtFirstName">Please input!</asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td>
                Title:
            </td>
            <td>
                <asp:DropDownList ID="DDLTittle" runat="server">
                    <asp:ListItem>CEO</asp:ListItem>
                    <asp:ListItem>Vice President, Sales</asp:ListItem>
                    <asp:ListItem>Sales Manager</asp:ListItem>
                    <asp:ListItem>Sales Representative</asp:ListItem>
                    <asp:ListItem>Staff</asp:ListItem>
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td>
                Title Of Courtesty:
            </td>
            <td>
                <asp:DropDownList ID="DDLTitleOfCourtesty" runat="server">
                    <asp:ListItem>Mr.</asp:ListItem>
                    <asp:ListItem>Mrs.</asp:ListItem>
                    <asp:ListItem>Ms.</asp:ListItem>
                    <asp:ListItem>Dr.</asp:ListItem>
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td>
                BirthDay:
            </td>
            <td>
                <asp:TextBox ID="txtBirthDay" runat="server"></asp:TextBox>
                <a href="#" onclick="cal.select(document.forms['form1'].txtBirthDay,'anchor1','MM/dd/yyyy'); return false;"
                    name="anchor1" id="anchor1">select</a>
                <asp:CustomValidator ID="cvBirthDate" runat="server" ErrorMessage="CustomValidator"
                    OnServerValidate="cvBirthDate_ServerValidate"></asp:CustomValidator>
            </td>
        </tr>
        <tr>
            <td>
                Hire Day:
            </td>
            <td>
                <asp:TextBox ID="txtHireDay" runat="server"></asp:TextBox>
                <a href="#" onclick="cal.select(document.forms['form1'].txtHireDay,'anchor1','MM/dd/yyyy'); return false;"
                    name="anchor1" id="a1">select</a>
                <asp:CustomValidator ID="cvHireDay" runat="server" ErrorMessage="CustomValidator"
                    OnServerValidate="cvHireDay_ServerValidate"></asp:CustomValidator>
            </td>
        </tr>
        <tr>
            <td>
                Address:
            </td>
            <td>
                <asp:TextBox ID="txtAddress" runat="server"></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvAddress" runat="server" ControlToValidate="txtAddress">Please input!</asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td>
                City:
            </td>
            <td>
                <asp:TextBox ID="txtCity" runat="server"></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvCity" runat="server" ControlToValidate="txtCity"
                    ErrorMessage="RequiredFieldValidator">Please input!</asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td>
                Region:
            </td>
            <td>
                <asp:TextBox ID="txtRegion" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
                Postal Code:
            </td>
            <td>
                <asp:TextBox ID="txtPostalCode" runat="server"></asp:TextBox>
                <asp:RangeValidator ID="rvPostalCode" runat="server" ControlToValidate="txtPostalCode"
                    ErrorMessage="RangeValidator" MaximumValue="99999" MinimumValue="10000" Type="Integer">Have five number!</asp:RangeValidator>
            </td>
        </tr>
        <tr>
            <td>
                Country:
            </td>
            <td>
                <asp:DropDownList ID="DDLCountry" runat="server">
                    <asp:ListItem>Brazil</asp:ListItem>
                    <asp:ListItem>Finland</asp:ListItem>
                    <asp:ListItem>USA</asp:ListItem>
                    <asp:ListItem>Italy</asp:ListItem>
                    <asp:ListItem>Germany</asp:ListItem>
                    <asp:ListItem>Mexico</asp:ListItem>
                    <asp:ListItem>Argentina</asp:ListItem>
                    <asp:ListItem>Switzerland</asp:ListItem>
                    <asp:ListItem>Sweden</asp:ListItem>
                    <asp:ListItem>Austria</asp:ListItem>
                    <asp:ListItem>UK</asp:ListItem>
                    <asp:ListItem>Poland</asp:ListItem>
                    <asp:ListItem>Canada</asp:ListItem>
                    <asp:ListItem>Ireland</asp:ListItem>
                    <asp:ListItem>France</asp:ListItem>
                    <asp:ListItem>Norway</asp:ListItem>
                    <asp:ListItem>Venezuela</asp:ListItem>
                    <asp:ListItem>Belgium</asp:ListItem>
                    <asp:ListItem>Spain</asp:ListItem>
                    <asp:ListItem>Denmark</asp:ListItem>
                    <asp:ListItem>Portugal</asp:ListItem>
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td>
                Phone:
            </td>
            <td>
                <asp:TextBox ID="txtPhone" runat="server"></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvPhone" runat="server" ControlToValidate="txtPhone"
                    ErrorMessage="RequiredFieldValidator" Display="Dynamic">Please input!</asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtPhone"
                    ErrorMessage="Wrong Phone Number!" 
                    ValidationExpression="\(?\d?\d?\d?\)?\ *\d\d\d\-?\ ?\d\d\d\d\d*"></asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td>
                Manager Name:
            </td>
            <td>
                <asp:DropDownList ID="DDLManagerName" runat="server">
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td>
                No Manager:
            </td>
            <td>
                <asp:CheckBox ID="ckbManagerName" runat="server" />
            </td>
        </tr>
        <table>
            <tr>
                <td>
                    <asp:Button ID="btnNew" runat="server" Text="New" OnClick="btnNew_Click" CausesValidation="False" />
                    <asp:Button ID="btnAdd" runat="server" Text="Add" OnClick="btnAdd_Click" />
                    <asp:Button ID="btnUpdate" runat="server" Text="Update" OnClick="btnUpdate_Click" />
                    <asp:Button ID="btnDelete" runat="server" Text="Delete" OnClick="btnDelete_Click"
                        CausesValidation="False" />
                </td>
            </tr>
        </table>
        <table>
            <tr>
                <td>
                    <asp:TextBox ID="txtSearch" runat="server"></asp:TextBox>
                    <asp:DropDownList ID="DDLSearch" runat="server">
                        <asp:ListItem>Search By</asp:ListItem>
                        <asp:ListItem>Name</asp:ListItem>
                        <asp:ListItem>Title</asp:ListItem>
                    </asp:DropDownList>
                    <asp:Button ID="btnSearch" runat="server" Text="Search" OnClick="btnSearch_Click"
                        CausesValidation="False" />
                </td>
            </tr>
        </table>
        <table>
            <tr>
                <td>
                    <asp:Button ID="btnReload" runat="server" OnClick="btnReload_Click" Text="Reload"
                        CausesValidation="False" />
                </td>
            </tr>
        </table>
    </table>
    <asp:GridView ID="gvEmployees" runat="server" OnPageIndexChanging="gvEmployees_PageIndexChanging"
        OnSelectedIndexChanged="gvEmployees_SelectedIndexChanged" AutoGenerateColumns="false">
        <Columns>
            <asp:BoundField DataField="empid" HeaderText="ID" />
            <asp:BoundField DataField="lastname" HeaderText="Last Name" />
            <asp:BoundField DataField="firstname" HeaderText="First Name" />
            <asp:BoundField DataField="title" HeaderText="Title" />
            <asp:BoundField DataField="titleofcourtesy" HeaderText="Title Of Courtesy" />
            <asp:BoundField DataField="birthdate" HeaderText="Birth Date" />
            <asp:BoundField DataField="hiredate" HeaderText="Hire Date" />
            <asp:BoundField DataField="address" HeaderText="Address" />
            <asp:BoundField DataField="city" HeaderText="City" />
            <asp:BoundField DataField="region" HeaderText="Region" />
            <asp:BoundField DataField="postalcode" HeaderText="Postal Code" />
            <asp:BoundField DataField="country" HeaderText="Country" />
            <asp:BoundField DataField="phone" HeaderText="Phone" />
            <asp:BoundField DataField="mgrid" HeaderText="Manager Name ID" />
        </Columns>
    </asp:GridView>
</asp:Content>
